function getDataJSON(options) {

    // var url = reqUrl[options.name] + "?t=" + new Date().getTime();
    var url = options.url || reqUrl[options.name];
    var data = options.data || {};
    var success = options.success || null;
    var complete = options.complete || null;
    var type = options.type || "get";
    var cachetype = options.cachetype || true;
    var error = options.error || null;

    $.ajax({
        url: url,
        data: data,
        type: type,
        contentType: 'application/json',
        cache: cachetype,
        success: function (data) {
            if (success) {
                success(data)
            } else {
                console.log(data)
            }
        },
        error: function (data) {
            if (error) {
                error(data)
            } else {
                console.log(data)
            }
        },
        complete: function () {
            if (complete) {
                complete()
            }
        }
    })
}

var reqUrl = {
    'getHistorySpotDataCount': new_url + '/rf/getHistorySpotDataCount',
    'getHistorySpotDataAllCount': new_url + '/rf/getHistorySpotDataAllCount',

}

function getHistorySpotDataCount(options) {
    var options = {
        name: "getHistorySpotDataCount",
        data: options.data,
        type: "post",
        success: options.success,
        complete: options.complete
    }
    getDataJSON(options);
}


function getHistorySpotDataAllCount(options) {
    var options = {
        name: "getHistorySpotDataAllCount",
        data: options.data,
        type: "post",
        success: options.success,
        complete: options.complete
    }
    getDataJSON(options);
}
